<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

	<title>Class: GlobalSetting</title>

	<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />

	<script src="./js/jquery.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/thickbox-compressed.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/quicksearch.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/darkfish.js" type="text/javascript"
		charset="utf-8"></script>

</head>
<body class="class">

	<div id="metadata">
		<div id="home-metadata">
			<div id="home-section" class="section">
        <h3 class="section-header">
          <a href="./index.html">Home</a>
          <a href="./index.html#classes">Classes</a>
          <a href="./index.html#methods">Methods</a>
        </h3>
			</div>
		</div>

		<div id="file-metadata">
			<div id="file-list-section" class="section">
				<h3 class="section-header">In Files</h3>
				<div class="section-body">
					<ul>
					
						<li><a href="./app/models/global_setting_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
							class="thickbox" title="app/models/global_setting.rb">app/models/global_setting.rb</a></li>
					
					</ul>
				</div>
			</div>

			
		</div>

		<div id="class-metadata">

			<!-- Parent Class -->
			
			<div id="parent-class-section" class="section">
				<h3 class="section-header">Parent</h3>
				
				<p class="link">ActiveRecord::Base</p>
				
			</div>
			

			<!-- Namespace Contents -->
			

			<!-- Method Quickref -->
			
			<div id="method-list-section" class="section">
				<h3 class="section-header">Methods</h3>
				<ul class="link-list">
					
					<li><a href="#method-c-%5B%5D">::[]</a></li>
					
					<li><a href="#method-c-get_instance">::get_instance</a></li>
					
					<li><a href="#method-c-theme_list">::theme_list</a></li>
					
				</ul>
			</div>
			

			<!-- Included Modules -->
			
		</div>

		<div id="project-metadata">
			
			
			<div id="fileindex-section" class="section project-section">
				<h3 class="section-header">Files</h3>
				<ul>
				
					<li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a></li>
				
				</ul>
			</div>
			

			<div id="classindex-section" class="section project-section">
				<h3 class="section-header">Class Index
					<span class="search-toggle"><img src="./images/find.png"
						height="16" width="16" alt="[+]"
						title="show/hide quicksearch" /></span></h3>
				<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
				<fieldset>
					<legend>Quicksearch</legend>
					<input type="text" name="quicksearch" value=""
						class="quicksearch-field" />
				</fieldset>
				</form>

				<ul class="link-list">
				
					<li><a href="./Portal.html">Portal</a></li>
				
					<li><a href="./Portal/FriendsController.html">Portal::FriendsController</a></li>
				
					<li><a href="./Portal/FriendsHelper.html">Portal::FriendsHelper</a></li>
				
					<li><a href="./Portal/MessageAttachmentsController.html">Portal::MessageAttachmentsController</a></li>
				
					<li><a href="./Portal/MessageAttachmentsHelper.html">Portal::MessageAttachmentsHelper</a></li>
				
					<li><a href="./Portal/MessageDestinationsController.html">Portal::MessageDestinationsController</a></li>
				
					<li><a href="./Portal/MessageDestinationsHelper.html">Portal::MessageDestinationsHelper</a></li>
				
					<li><a href="./Portal/MessageFoldersController.html">Portal::MessageFoldersController</a></li>
				
					<li><a href="./Portal/MessageFoldersHelper.html">Portal::MessageFoldersHelper</a></li>
				
					<li><a href="./Portal/MessageOutboxController.html">Portal::MessageOutboxController</a></li>
				
					<li><a href="./Portal/MessageOutboxHelper.html">Portal::MessageOutboxHelper</a></li>
				
					<li><a href="./Portal/MessageRulesController.html">Portal::MessageRulesController</a></li>
				
					<li><a href="./Portal/MessageRulesHelper.html">Portal::MessageRulesHelper</a></li>
				
					<li><a href="./Portal/MessagesController.html">Portal::MessagesController</a></li>
				
					<li><a href="./Portal/MessagesHelper.html">Portal::MessagesHelper</a></li>
				
					<li><a href="./Portal/ProfilesController.html">Portal::ProfilesController</a></li>
				
					<li><a href="./Portal/ProfilesHelper.html">Portal::ProfilesHelper</a></li>
				
					<li><a href="./Portal/TopController.html">Portal::TopController</a></li>
				
					<li><a href="./Portal/TopHelper.html">Portal::TopHelper</a></li>
				
					<li><a href="./Common.html">Common</a></li>
				
					<li><a href="./Common/InvitesController.html">Common::InvitesController</a></li>
				
					<li><a href="./Common/InvitesHelper.html">Common::InvitesHelper</a></li>
				
					<li><a href="./Common/SettingsController.html">Common::SettingsController</a></li>
				
					<li><a href="./Common/SettingsHelper.html">Common::SettingsHelper</a></li>
				
					<li><a href="./Common/UserSessionsController.html">Common::UserSessionsController</a></li>
				
					<li><a href="./Common/UserSessionsHelper.html">Common::UserSessionsHelper</a></li>
				
					<li><a href="./Common/UsersController.html">Common::UsersController</a></li>
				
					<li><a href="./Common/UsersHelper.html">Common::UsersHelper</a></li>
				
					<li><a href="./Admin.html">Admin</a></li>
				
					<li><a href="./Admin/AdminController.html">Admin::AdminController</a></li>
				
					<li><a href="./Admin/GlobalSettingsController.html">Admin::GlobalSettingsController</a></li>
				
					<li><a href="./Admin/GlobalSettingsHelper.html">Admin::GlobalSettingsHelper</a></li>
				
					<li><a href="./Admin/SystemMessagesController.html">Admin::SystemMessagesController</a></li>
				
					<li><a href="./Admin/SystemMessagesHelper.html">Admin::SystemMessagesHelper</a></li>
				
					<li><a href="./Admin/UsersController.html">Admin::UsersController</a></li>
				
					<li><a href="./Admin/UsersHelper.html">Admin::UsersHelper</a></li>
				
					<li><a href="./Mobile.html">Mobile</a></li>
				
					<li><a href="./Mobile/EmoticonHelper.html">Mobile::EmoticonHelper</a></li>
				
					<li><a href="./Mobile/LinkRenderer.html">Mobile::LinkRenderer</a></li>
				
					<li><a href="./ApplicationController.html">ApplicationController</a></li>
				
					<li><a href="./ApplicationHelper.html">ApplicationHelper</a></li>
				
					<li><a href="./AvatarUploader.html">AvatarUploader</a></li>
				
					<li><a href="./BlogAttachmentUploader.html">BlogAttachmentUploader</a></li>
				
					<li><a href="./BoardMessageAttachmentUploader.html">BoardMessageAttachmentUploader</a></li>
				
					<li><a href="./CarrierWaveExtension.html">CarrierWaveExtension</a></li>
				
					<li><a href="./CommonUtils.html">CommonUtils</a></li>
				
					<li><a href="./CommunityAvatarUploader.html">CommunityAvatarUploader</a></li>
				
					<li><a href="./Friend.html">Friend</a></li>
				
					<li><a href="./FriendRequest.html">FriendRequest</a></li>
				
					<li><a href="./GlobalSetting.html">GlobalSetting</a></li>
				
					<li><a href="./Invite.html">Invite</a></li>
				
					<li><a href="./Message.html">Message</a></li>
				
					<li><a href="./MessageAttachment.html">MessageAttachment</a></li>
				
					<li><a href="./MessageAttachmentUploader.html">MessageAttachmentUploader</a></li>
				
					<li><a href="./MessageFolder.html">MessageFolder</a></li>
				
					<li><a href="./MessageRecipient.html">MessageRecipient</a></li>
				
					<li><a href="./MessageRule.html">MessageRule</a></li>
				
					<li><a href="./Profile.html">Profile</a></li>
				
					<li><a href="./Role.html">Role</a></li>
				
					<li><a href="./Setting.html">Setting</a></li>
				
					<li><a href="./SnsMailer.html">SnsMailer</a></li>
				
					<li><a href="./SystemMessage.html">SystemMessage</a></li>
				
					<li><a href="./User.html">User</a></li>
				
					<li><a href="./UserSession.html">UserSession</a></li>
				
				</ul>
				<div id="no-class-search-results" style="display: none;">No matching classes.</div>
			</div>

			
		</div>
	</div>

	<div id="documentation">
		<h1 class="class">GlobalSetting</h1>

		<div id="description">
			<h3>SNS全体の設定情報管理用モデル</h3>

		</div>

		<!-- Constants -->
		
		<div id="constants-list" class="section">
			<h3 class="section-header">Constants</h3>
			<dl>
			
				<dt><a name="DEFAULTS">DEFAULTS</a></dt>
				
				<dd class="description"><p>
システム設定のデフォルト値をハッシュ形式で保持する。
</p></dd>
				
			
			</dl>
		</div>
		

		<!-- Attributes -->
		

		<!-- Methods -->
		
		<div id="public-class-method-details" class="method-section section">
			<h3 class="section-header">Public Class Methods</h3>

		
			<div id="--method" class="method-detail ">
				<a name="method-c-%5B%5D"></a>

				<div class="method-heading">
				
					<span class="method-name">[]</span><span
						class="method-args">(value)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>システム設定情報の取得用アクセサ</h3>
<p>
任意のコントローラ・モデル・ビューからシステム設定をハッシュ形式で参照 できるようにするメソッド シングルトンレコードを返すことで一意性を保証する。
</p>
					

					
					<div class="method-source-code"
						id="--source">
<pre>
    <span class="ruby-comment cmt"># File app/models/global_setting.rb, line 15</span>
15:   <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">value</span>)
16:     <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_instance</span>[<span class="ruby-identifier">value</span>]
17:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="get-instance-method" class="method-detail ">
				<a name="method-c-get_instance"></a>

				<div class="method-heading">
				
					<span class="method-name">get_instance</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>シングルトンレコードの取得</h3>
					

					
					<div class="method-source-code"
						id="get-instance-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/global_setting.rb, line 20</span>
20:   <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_instance</span>
21:     <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">all</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
22:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create</span>(<span class="ruby-constant">DEFAULTS</span>)
23:     <span class="ruby-keyword kw">else</span>
24:       <span class="ruby-keyword kw">return</span> <span class="ruby-constant">GlobalSetting</span>.<span class="ruby-identifier">first</span>
25:     <span class="ruby-keyword kw">end</span>
26:   <span class="ruby-keyword kw">rescue</span>
27:     <span class="ruby-keyword kw">return</span> <span class="ruby-constant">DEFAULTS</span>
28:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="theme-list-method" class="method-detail ">
				<a name="method-c-theme_list"></a>

				<div class="method-heading">
				
					<span class="method-name">theme_list</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<h3>システムに実装済みのテーマリストの取得</h3>
<p>
web-app-themesプラグインによって管理されるテーマの一覧をディレクトリから 取得する
</p>
					

					
					<div class="method-source-code"
						id="theme-list-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/global_setting.rb, line 33</span>
33:   <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">theme_list</span>
34:     <span class="ruby-identifier">results</span> = []
35:     <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Rails</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">&quot;public&quot;</span>, <span class="ruby-value str">&quot;stylesheets&quot;</span>, <span class="ruby-value str">&quot;web-app-theme&quot;</span>, <span class="ruby-value str">&quot;themes&quot;</span>)
36:     <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">foreach</span>(<span class="ruby-identifier">path</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
37:       <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">item</span>))
38:       <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">item</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A\./</span>
39:       <span class="ruby-identifier">results</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">item</span>
40:     <span class="ruby-keyword kw">end</span>
41:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">results</span>
42:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
		</div>
	

	</div>


	<div id="rdoc-debugging-section-dump" class="debugging-section">
	
		<p>Disabled; run with --debug to generate this.</p>
	
	</div>

	<div id="validator-badges">
		<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
		<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
			Rdoc Generator</a> 1.1.6</small>.</p>
	</div>

</body>
</html>

